MkDetailsBlock
Pymdownx-based details box.¶
Bases: MkBlock
__init__ ¶
__init__(
content: str | list | mk.MkNode | None = None,
*,
typ: datatypes.AdmonitionTypeStr = "info",
expanded: bool | None = None,
title: str | None = None,
**kwargs: Any
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
content |
str | list | MkNode | None
|
Admonition content |
None
|
typ |
AdmonitionTypeStr
|
Admonition type |
'info'
|
expanded |
bool | None
|
Whether the details block should be expanded initially |
None
|
title |
str | None
|
Optional Admonition title |
None
|
kwargs |
Any
|
Keyword arguments passed to parent |
{}
|
Name | Children | Inherits |
---|---|---|
MkBlock mknodes.basenodes.mkblock PyMdown-based block. |
graph TD
94854582997696["mkdetailsblock.MkDetailsBlock"]
94854582920960["mkblock.MkBlock"]
94854582919984["mkcontainer.MkContainer"]
94854582916880["mknode.MkNode"]
94854582838576["node.Node"]
140544995341632["builtins.object"]
94854582920960 --> 94854582997696
94854582919984 --> 94854582920960
94854582916880 --> 94854582919984
94854582838576 --> 94854582916880
140544995341632 --> 94854582838576
/home/runner/work/mknodes/mknodes/mknodes/basenodes/mkdetailsblock/metadata.toml
[metadata]
icon = "octicon:info-16"
name = "MkDetailsBlock"
[requirements.extension."pymdownx.blocks.details"]
[examples.regular]
title = "Regular"
jinja = """
{{ "Different types." | MkDetailsBlock(typ="warning") }}
"""
[examples.collapsible]
title = "Collapsible and expandable"
jinja = """
{{ "MkDetailsBlocks can also be expanded." | MkDetailsBlock(expanded=True) }}
"""
[output.markdown]
template = """
{{ node.fence_boundary }} details{% if node.argument %}" | " ~ {{ node.argument }}{% endif %}
type: {{ node.typ }}
{% if node.expanded %} open: True
{% endif %}
{{ node.items | join }}
{{ node.fence_boundary }}
"""